<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %> 
<c:choose>
	<c:when test="${!empty errorMsg}">
		<font color="red">${errorMsg}</font>
	</c:when>
	<c:otherwise>
		<div class="accountInfo">
			<p><span>结算费用总计：<font color="red" ><fmt:formatNumber value="${totalFee}" type="number" pattern="￥0.00" /></font> </span></p>
			<br>
			话费激励结算：<fmt:formatNumber value="${telfeeTotalFee}" type="number" pattern="￥0.00" />；&nbsp;&nbsp;
			现金激励结算：<fmt:formatNumber value="${cashTotalFee}" type="number" pattern="￥0.00" />；&nbsp;&nbsp;
			客户经理结算：<fmt:formatNumber value="${custTotalFee}" type="number" pattern="￥0.00" />；&nbsp;&nbsp;
			行业经理结算：<fmt:formatNumber value="${bumgrTotalFee}" type="number" pattern="￥0.00" />。&nbsp;&nbsp;
		</div>
		<div class="pageContent sortDrag" selector="h1" layoutH="100">		
			<c:choose>
				<c:when test="${!empty telfeeList }">
					<div class="panel collapse" >
						<h1>话费激励结算<font color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<fmt:formatNumber value="${telfeeTotalFee}" type="number" pattern="￥0.00" /></font></h1>
						<div>
							<table class="list" width="100%" targetType="dialog" >
								<thead>
									<tr>
										<th>序号</th>
										<th>结算单据</th>
										<th>学校</th>
										<th>结算日期</th>
										<th>部门</th>
										<th>拓展人员</th>
										<th>维护人员</th>
										<th>电话费</th>
										<th>操作员费用</th>
										<th>结算费用</th>
										<th>批复金额</th>
										<th>备注</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${telfeeList }" var="bal" varStatus="status">
										<tr>
											<td>${(status.index+1)}</td>
											<td>${bal.billCode }</td>
											<td>${bal.sclName }</td>
											<td><fmt:parseDate value="${bal.ywEndDate}" var="ywEndDate" pattern="yyyyMMdd" /> 
											    <fmt:formatDate value="${ywEndDate}" pattern="yyyy-MM-dd" /></td>
											<td>${bal.saleDeptName}</td>
											<td>${bal.saleUserName}</td>
											<td>${bal.saleKeepName}</td>
											<td><fmt:formatNumber value="${bal.telFee}"	type="number" pattern="￥0.00" /></td>
											<td><fmt:formatNumber value="${bal.operFee}"	type="number" pattern="￥0.00" /></td>
											<td><fmt:formatNumber value="${bal.balFee}" type="number" pattern="￥0.00" /></td>
											<td><fmt:formatNumber value="${bal.payFee}" type="number" pattern="￥0.00" /></td>
											<td>${bal.specDeclare}</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
					</div>
				</c:when>
			</c:choose>
			
			<c:choose>
				<c:when test="${!empty cashList }">
					<div class="panel collapse">
						<h1>现金激励结算<font color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<fmt:formatNumber value="${cashTotalFee}" type="number" pattern="￥0.00" /></font></h1>
						<div>
							<table class="list" width="100%" targetType="dialog" >
								<thead>
									<tr>
										<th>序号</th>
										<th>结算单据</th>
										<th>学校</th>
										<th>结算日期</th>
										<th>部门</th>
										<th>拓展人员</th>
										<th>维护人员</th>
										<th>在校生人数</th>
										<th>开通量</th>
										<th>开通率</th>
										<th>结算费用</th>
										<th>批复金额</th>
										<th>备注</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${cashList }" var="bal" varStatus="status">
										<tr >
											<td>${(status.index+1)}</td>
											<td>${bal.billCode }</td>
											<td>${bal.sclName }</td>
											<td><fmt:parseDate value="${bal.ywEndDate}"
													var="ywEndDate" pattern="yyyyMMdd" /> <fmt:formatDate
													value="${ywEndDate}" pattern="yyyy-MM-dd" /></td>
											<td>${bal.saleDeptName }</td>
											<td>${bal.saleUserName}</td>
											<td>${bal.saleKeepName}</td>
											<td>${bal.inschNum}</td>
											<td>${bal.inschOpenNum}</td>
											<td><fmt:formatNumber value="${bal.ywUseRate}" type="number" pattern="0.00%" /> </td>
											<td><fmt:formatNumber value="${bal.balFee}"	type="number" pattern="￥0.00" /></td>
											<td><fmt:formatNumber value="${bal.payFee}"	type="number" pattern="￥0.00" /></td>
											<td>${bal.specDeclare}</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
					</div>
				</c:when>
			</c:choose>
			
			<c:choose>
				<c:when test="${!empty custList }">
					<div class="panel collapse">
						<h1>客户经理结算<font color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<fmt:formatNumber value="${custTotalFee}" type="number" pattern="￥0.00" /></font></h1>
						<div>
							<table class="list" width="100%" targetType="dialog" >
								<thead>
									<tr>
										<th>序号</th>
										<th>结算单据</th>
										<th>学校</th>
										<th>结算日期</th>
										<th>部门</th>
										<th>拓展人员</th>
										<th>维护人员</th>
										<th>客户经理</th>
										<th>在校生人数</th>
										<th>开通量</th>
										<th>开通率</th>
										<th>结算费用</th>
										<th>批复金额</th>
										<th>备注</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${custList }" var="bal" varStatus="status">
										<tr>
											<td>${(status.index+1)}</td>
											<td>${bal.billCode }</td>
											<td>${bal.sclName }</td>
											<td><fmt:parseDate value="${bal.ywEndDate}"
													var="ywEndDate" pattern="yyyyMMdd" /> <fmt:formatDate
													value="${ywEndDate}" pattern="yyyy-MM-dd" /></td>
											<td>${bal.saleDeptName }</td>
											<td>${bal.saleUserName}</td>
											<td>${bal.saleKeepName}</td>
											<td>${bal.mobManagerName}</td>
											<td>${bal.inschNum}</td>
											<td>${bal.inschOpenNum}</td>
											<td><fmt:formatNumber value="${bal.ywUseRate}" type="number" pattern="0.00%" /> </td>
											<td><fmt:formatNumber value="${bal.balFee}" type="number" pattern="￥0.00" /></td>
											<td><fmt:formatNumber value="${bal.payFee}" type="number" pattern="￥0.00" /></td>
											<td>${bal.specDeclare}</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
					</div>
				</c:when>
			</c:choose>
			
			<c:choose>
				<c:when test="${!empty buMgrList }">
					<div class="panel collapse">
						<h1>行业经理结算<font color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<fmt:formatNumber value="${bumgrTotalFee}" type="number" pattern="￥0.00" /></font></h1>
						<div>
							<table width="100%">
								<tr>
									<td>
										<table class="list" width="100%" targetType="dialog" >
											<thead>
												<tr>
													<th>序号</th>
													<th>结算单据</th>
													<th>地区</th>
													<th>结算日期</th>
													<th>学校数</th>
													<th>本期学生数</th>
													<th>上期用户数</th>
													<th>本期用户数</th>
													<th>新增用户数</th>
													<th>结算费用</th>
													<th>批复金额</th>
													<th>备注</th>
												</tr>
											</thead>
											<tbody>
												<c:forEach items="${buMgrList }" var="bal" varStatus="status">
													<tr>
														<td>${(status.index+1)}</td>
														<td>${bal.billCode }</td>
														<td>${bal.areaName }</td>
														<td>
															<fmt:parseDate value="${bal.ywEndDate}" var="ywEndDate" pattern="yyyyMMdd" /> 
															<fmt:formatDate value="${ywEndDate}" pattern="yyyy-MM-dd" />
														</td>
														<td>${bal.sclNum }</td>
														<td>${bal.stuNum}</td>
														<td>${bal.popenNum}</td>
														<td>${bal.openNum}</td>
														<td>${bal.addOpenNum}</td>
														<td>
															<fmt:formatNumber value="${bal.balFee}" type="number" pattern="￥0.00" />
														</td>
														<td>
															<fmt:formatNumber value="${bal.payFee}" type="number" pattern="￥0.00" />
														</td>
														<td>${bal.specDeclare}</td>
													</tr>
												</c:forEach>
											</tbody>
										</table>
									</td>
								</tr>
							</table>
						</div>
					</div>
				</c:when>
			</c:choose>
		</div>
		
	</c:otherwise>
</c:choose>







